package Manager.Help;

import java.awt.Color;

import javax.swing.*;
import javax.swing.border.*;

import Database.*;
import Exception.*;

public class PanelTools extends JPanel
{
	//Variable Declaration
	private JButton buttonBackup, buttonRestore, buttonLogs;
	
	//test
	private CallDB callDB;
	
	public PanelTools(String choice) throws LoadDriverException
	{
		setLayout(null);
		setBorder(new BevelBorder(BevelBorder.RAISED, Color.ORANGE, Color.RED, Color.BLUE, Color.BLACK));
		
		callDB = new CallDB();
		
		creationComponent(choice);
		showComponent();
	}
	
	public void creationComponent(String choice)
	{
		buttonBackup = new JButton("Backup");
		buttonBackup.setBounds(167, 40, 150, 35);
		
		buttonRestore = new JButton("Restore");
		buttonRestore.setBounds(167, 120, 150, 35);
		
		buttonLogs = new JButton("Logs");
		buttonLogs.setBounds(167, 200, 150, 35);
		
		if(choice.equals("Backup"))
		{
			buttonRestore.setEnabled(false);
			buttonLogs.setEnabled(false);
		}
		else if(choice.equals("Restore"))
			{
				buttonBackup.setEnabled(false);
				buttonLogs.setEnabled(false);
			}
		else
		{
			buttonBackup.setEnabled(false);
			buttonRestore.setEnabled(false);
		}
	}
	
	public void showComponent()
	{
		this.add(buttonBackup);
		this.add(buttonRestore);
		this.add(buttonLogs);
	}
	
	public JButton getButtonBackup(){return buttonBackup;}
	public JButton getButtonRestore(){return buttonRestore;}
	public JButton getButtonLogs(){return buttonLogs;}
}